﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common;
using Wix.Aura.Common.CustomTypes;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class BinarySerialization : ProductChildren {
		[Test]
		public void TestIdParameter() {
			string id = "BinaryID";

			string expected = string.Format(@"<Binary Id=""{0}"" />", id);
			expected = string.Format(baseXml, expected);

			BinaryFile binary = new BinaryFile(id);
			project.Product.Binary.Add(binary);

			Assertion(expected, project);
		}

		[Test]
		public void AllAttributes() {
			string id = "BinaryID";

			string expected = string.Format(@"<Binary Id=""{0}"" SourceFile=""SourceFile"" SuppressModularization=""yes"" />", id);
			expected = string.Format(baseXml, expected);

			BinaryFile binary = new BinaryFile(id);
			binary.SourceFile = "SourceFile";
			binary.SuppressModularization = YesNoType.Yes;
			project.Product.Binary.Add(binary);

			Assertion(expected, project);
		}
	}
}
